package com.atguigu.spzx.manager.mapper;

import com.atguigu.spzx.model.dto.system.SysUserDto;
import com.atguigu.spzx.model.entity.system.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName: SysUserMapper
 * Package:
 * Description:
 *
 * @Author:xiaohei
 * @Create 2024/5/16 23:13
 * Version 1.0
 */
@Mapper
public interface SysUserMapper {

    /**
     * 根据用户名查询用户数据
     * @param username
     * @return
     */
    @Select("select * from sys_user where username = #{username} and is_deleted = 0")
    SysUser selectUserInfoByUserName(String username);

    List<SysUser> findByPage(SysUserDto sysUserDto);

    void save(SysUser sysUser);

    void updateUser(SysUser sysUser);

    void deleteById(Integer userId);
}
